@if (currentUrl == "/aily-chat") {
<app-sub-window [title]="windowInfo" [winBtns]="['go-main', 'minimize', 'maximize', 'close']">
  <ng-container *ngTemplateOutlet="windowBoxTemplate"></ng-container>
</app-sub-window>
} @else {
<app-tool-container [title]="windowInfo" (closeEvent)="close()">
  <ng-container header-btns>
    <div class="btn ccenter" (click)="newChat()">
      <i class="fa-light fa-message-plus"></i>
    </div>
    <!-- <div class="btn ccenter" (click)="openHistoryChat($event)">
      <i class="fa-light fa-clock-rotate-left"></i>
    </div> -->
  </ng-container>
  <ng-container *ngTemplateOutlet="windowBoxTemplate"></ng-container>
</app-tool-container>
}
<ng-template #windowBoxTemplate>
  <div class="window-box">
    <!-- 对话内容 -->
    <div class="dialog-list" #chatContainer>
      @if(list.length > 0){
      <ngx-simplebar [options]="options">
        <div class="dialogs" #chatList>
          @for (item of list; track item) {
          <aily-dialog [data]="item"></aily-dialog>
          }
        </div>
      </ngx-simplebar>
      }@else{
      <div class="guide-box ccenter">
        <i class="fa-light fa-star-christmas"></i>
        <div class="title">aily assistant service</div>
        <div class="text">AI的回复仅能作为参考，不一定正确，也不代表本软件开发者的意见，使用者需自行辨别</div>
        <div></div>
      </div>
      }
    </div>
    <!-- 发送部分 -->
    <div class="sender" nz-resizable [style.height.px]="bottomHeight" [nzMaxHeight]="600" [nzMinHeight]="180"
      (nzResize)="onContentResize($event)">
      <nz-resize-handle nzDirection="top">
        <div class="line"></div>
      </nz-resize-handle>

      <div class="s-box">
        <!-- 快捷发送栏 -->
        <!-- <div class="settings" style="padding: 0;">
          <div class="btns">
            <div class="btn ccenter" nz-tooltip nzTooltipTitle="添加文件">
              <i class="fa-light fa-file-circle-plus"></i>
            </div>
          </div>
        </div> -->
        <div class="input-box">
          <textarea class="sscroll" spellcheck="false" nz-input [(ngModel)]="inputValue"
            (keydown)="onKeyDown($event)"></textarea>
        </div>
        <div class="btns">
          <div class="btn ccenter enter" nz-tooltip nzTooltipTitle="添加文件" (click)="addFile()">
            <i class="fa-light fa-file-plus"></i>
          </div>
          <!-- <div class="btn ccenter enter right3" nz-tooltip nzTooltipTitle="语音输入">
            <i class="fa-light fa-microphone"></i>
          </div> -->
          <button class="right ccenter" nz-button nzType="primary" nz-tooltip
            [nzTooltipTitle]="true?'Enter':'Ctrl+Enter'" (click)="send()">
            发送
          </button>
        </div>
      </div>
    </div>
  </div>
</ng-template>

@if (showHistoryList) {
<app-menu [menuList]="HistoryList" [position]="historyListPosition" [width]="300" (closeEvent)="closeMenu()"
  (itemClickEvent)="menuClick($event)"></app-menu>
}